<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">

    <title>学生页面</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <script src="../layui/layui.js"></script>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	  <!-- <link rel="stylesheet" href="/res.layui.com/layui/dist/css/layui.css?t=1541126280604" media="all"> -->
	  <style>
	    body{margin: 10px;}
	    .demo-carousel{height: 200px; line-height: 200px; text-align: center;}
	  	.layui-nav{
	  		background-color:gray;
	  		
	  	}
	  	.layui-logo{
	  		padding-left: 30px;
	  	}
	  	.sty:before{
	  		content: "";
	  		display: inline-block;
	  		height: 0px;
	  		width: 0px;
	  		border: 15px solid transparent;
	  		border-left-color: white;
	  		vertical-align: middle;
	  		position: relative;
	  		left: -20px;
	  	}
	  	.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after,
	  	.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this
	  	{
	  		background: #1E9FFF;
	  	}
	  	.layui-layout-admin .layui-logo{
	  		background: url(../img/logo1.png) no-repeat;
	  		background-size: contain;
	  		background-position-x: 10px;
	  	}
	  	
	  </style>
</head>

<body class="layui-layout-body">

	    <div class="layui-layout layui-layout-admin ">
	        <!-- 头部导航栏 -->
	        <div class="layui-header  layui-bg-blue">
	            <div class="layui-logo" ><font color="white">社萌管理平台</font></div>
	
	            <ul class="layui-nav layui-layout-left">
	                <li class="layui-nav-item">
	                    <a href="javascript:;">姓名：<span class="" id="Sname"></span></a>
	                </li>
	                <li class="layui-nav-item">
	                    <a href="javascript:;">学号：<span class="" id="Sid"></span></a>
	                </li>
	            </ul>
	             <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">设置</a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="">个人信息</a>
                        </dd>
                        <dd>
                            <a href="stu-changPass.html">修改密码</a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="">退出</a>
                </li>
            </ul>
			</div>
			<ul class="layui-nav sty" lay-filter="test">
			  <li class="layui-nav-item layui-this"><a href="welcome.html">首&nbsp;&nbsp;页</a></li>
			  <li class="layui-nav-item"><a href="party-myparty.html">我的社团</a></li>
			  <li class="layui-nav-item"><a href="party-myActive.html">我的活动</a></li>
			  <li class="layui-nav-item"><a href="party-allParty.html">社团荟萃</a></li>
			  <li class="layui-nav-item"><a href="party-allActive.html">活动展览</a></li>
			  <li class="layui-nav-item"><a>关于我们</a></li>
			</ul>
            <!-- 内容主体区域 -->
            <div style="width:100%;height:720px">
            	<iframe id="iframe" src="welcome.html" style="box-sizing: border-box; padding: 20px 15px 0 15px; width: 101%; height: 99.5%;"></iframe>
            </div>
    </div>
    <script>
        //JavaScript代码区域
        layui.use(['element','jquery'], function () {
            var element = layui.element
            var $ = layui.jquery

            var $navs = $('.layui-nav>.layui-nav-item').find('a:not(".layui-nav-item-title")')
            var $iframe = $('#iframe')
            $navs.click(function(event){
                var href = $(this).attr('href')
                $iframe.attr('src', href)
                
                event.preventDefault()
            })
            
            
             $.ajax({
            	type:"POST",
            	url:"/user/getStuUser",
            	dataType:"json",
            	error:function(){
            		console.log("error!");
            	},
            	success:function(data){
            		console.log(data);
            		$('#Sname').html(data.stu_name);
            		$('#Sid').html(data.stu_no);
            	}
            })
        
        })
    </script>
		</body>
</html>       